<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSessionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sessions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('code',20);
            $table->string('cinema_code',20);
            $table->string('screen_code',20);
            $table->string('film_code',20);
            $table->integer('film_id');
            $table->string('film_name',50);
            $table->string('screen_name',50);
            $table->integer('start_time');
            $table->integer('end_time');
            $table->string('b24h_start_time',20);
            $table->string('b24h_end_time',20);
            $table->integer('duration');
            $table->integer('language');
            $table->integer('share_proportion');
            $table->integer('lowest_price');
            $table->timestamp('business_date')->nullable();
            $table->integer('image');
            $table->integer('frame');
            $table->integer('price_plan_id')->nullable();
            $table->text('price_plan')->nullable();
            $table->integer('playthrough_flag')->default(2);
            $table->string('playthrough_name')->nullable();
            $table->integer('playthrough_price')->nullable();
            $table->integer('sequence')->default(1);
            $table->integer('seat_by_number')->default(1);
            $table->string('showtime_schedule_code',20)->nullable();
            $table->integer('status')->default(1);
            $table->integer('operate_id')->default(1);//统计序号
            $table->integer('statistics_id')->default(0);//操作序号
            $table->integer('project_id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sessions');
    }
}
